'use strict';
const db = uniCloud.database()
const myList = db.collection('my-list')
const dbComm = db.command

exports.main = async (event, context) => {
  const {
    value
  } = event

  //返回数据给客户端
  return myList.where(dbComm.or({
    title: new RegExp(value),
  }, {
    word: new RegExp(value),
  }, {
    price: new RegExp(value),
  })).get()
};
